home *** CD-ROM | disk | FTP | other *** search
- Path: tech.cftnet.com!usenet
- From: Marc Donovan <ams@cftnet.com>
- Newsgroups: comp.lang.c++
- Subject: Re: Borland OWL SetupWindow function
- Date: Thu, 11 Apr 1996 22:57:11 GMT
- Organization: CFTnet
- Message-ID: <4kk2ip$mv8@tech.cftnet.com>
- References: <DpMG63.JB9@grog.allware.com>
- NNTP-Posting-Host: ppp248_4.cftnet.com
- X-Newsreader: Forte Free Agent 1.0.82
-
- nathan@allware.com (Nathan Tocus) wrote:
-
- >How do you pass arguments to the SetupWindow function in OWL 2.5. All
- >the examples in the books I've read use SetupWindow to initialize
- >controls but they never pass it any arguments. Since this function is
- >called automatically when a window element is created and not
- >explicitly called from your program, it appears that you can't pass it
- >anything. The only way I have been able to make variables available
- >to SetupWindow is to use global variables, which I would rather avoid.
-
-
- Use member functions and member variables. You should inherit your
- class from TWindow (or TDialog, or whatever), and then use your own
- added functionality.
-
- class MyWindow ; public TWindow {
- public:
- virtual void SetupWindow (); // this gets called instead of
- //TWindow::SetupWindow
-
- void MyFunction ();
- int MyVariable;
- };
-
-
- void MyWindow::SetupWindow () {
- TWindow::SetupWindow
- //^^^^^^^^^^^^^^^^^^
- // This is VERY important and is
- // a major cause of errors.
-
- MyFunction ();
- // ^^^^^^
- // this can access / modify anything you want
-
- .
- .
- .
-
- }
-
-
-
-
-
-
- ****************************************************************
- Marc Donovan Commercial Computer Systems Inc.
- ams@cftnet.com St. Petersburg, FL
- (813) 579-0000 TANSTAAFL
- ****************************************************************
-
-